package com.async.handler.impl;

import com.async.enums.AsyncTypeEnum;
import com.async.handler.context.AsyncStrategyContext;
import com.async.handler.impl.AbstractAsyncHandlerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;

/**
 * <p>
 * 仅异步消息处理
 * </p>
 * @author yang
 * @date 2024/5/17
 */
@Slf4j
@Component
public class AsyncHandlerService extends AbstractAsyncHandlerService {
    @Override
    public boolean execute(AsyncStrategyContext context) {
        return asyncProducer.send(context.getAsyncExecDto());
    }

    @Override
    public List<String> listType() {
        return Collections.singletonList(AsyncTypeEnum.ASYNC.name());
    }
}
